Skip to content

feat(d_snd_harp_song_mrg): isPlayingHarpRelated and ancestors#264

Merged
elijah-thomas774 merged 5 commits intozeldaret:mainfrom
Asiern:d_snd_harp_song_mgr
Nov 16, 2025
Merged

feat(d_snd_harp_song_mrg): isPlayingHarpRelated and ancestors#264
elijah-thomas774 merged 5 commits intozeldaret:mainfrom
Asiern:d_snd_harp_song_mgr

Conversation

@Asiern
Copy link
Copy Markdown
Contributor

@Asiern Asiern commented Nov 12, 2025

Added isPlayingHarpRelated and its ancestor functions. Used by d_t_harp.

  • isPlayingHarpRelated – 100 %

  • fun_80381150 – 100%

  • isContinuousStrumming() – 100 %

Comment thread src/d/snd/d_snd_harp_song_mgr.cpp Outdated
Comment thread src/d/snd/d_snd_harp_song_mgr.cpp Outdated
Comment on lines +128 to +130
u8 dSndHarpSongMgr_c::fun_80381150() {
if (this->isContinuousStrumming()) {
return this->field_0x042;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
u8 dSndHarpSongMgr_c::fun_80381150() {
if (this->isContinuousStrumming()) {
return this->field_0x042;
bool dSndHarpSongMgr_c::fun_80381150() {
if (isContinuousStrumming()) {
return field_0x042;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By making field_0x42 a bool things can work out better.
/* 0x042 */ bool field_0x042;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change works much better now. I was initially hesitant because I didn’t want to introduce side‑effects elsewhere in the codebase. Since the field was previously declared as a u8, I assumed that was the intended type.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure u8 and bool conversions are pretty common because initially they appear the same until we have situations such as this.

Similar with the u16 vs s16 vs mAng, there may be cases were changing the type is needed just for one area.

I’ll enable the pr checker run so you can see the effects, but there is a way to setup ninja to get a baseline, then a command to check for and regressions. I think steps are somewhere on discord

Comment thread src/d/snd/d_snd_harp_song_mgr.cpp Outdated
Comment thread include/d/snd/d_snd_harp_song_mgr.h Outdated
@decomp-dev
Copy link
Copy Markdown

decomp-dev Bot commented Nov 14, 2025

Report for SOUE01 (67eda44 - 26f4a90)

📈 Matched code: 20.95% (+0.00%, +124 bytes)

✅ 3 new matches
Unit Function Bytes Before After
main/d/snd/d_snd_harp_song_mgr dSndHarpSongMgr_c::fn_80381150() +64 0.00% 100.00%
main/d/snd/d_snd_harp_song_mgr dSndHarpSongMgr_c::isPlayingHarpRelated() +40 0.00% 100.00%
main/d/snd/d_snd_harp_song_mgr dSndHarpSongMgr_c::isContinuousStrumming() +20 0.00% 100.00%

@elijah-thomas774
Copy link
Copy Markdown
Collaborator

Note: for changes to actually show up towards completion percentage, you may need to map the symbol from objdiff to the respective symbols.txt.

For example:

- isPlayingHarpRelated = .text:0x80381120; // type:function size:0x28
+ isPlayingHarpRelated__17dSndHarpSongMgr_cFv = .text:0x80381120; // type:function size:0x28

This can be grabbed from right clicking the function in objdiff:
image

Also: The order in which the function defined matters, so try to keep them in the right order

@Asiern
Copy link
Copy Markdown
Contributor Author

Asiern commented Nov 15, 2025

I mapped the symbols and now it shows 100 %, so I was missing that step. I've also renamed and reordered the function to match the original names/order.
Screenshot 2025-11-15 101923

Updated field_0x042 from u8 to bool to better reflect its binary nature.
Adjusted related logic accordingly.
- Rename fn_80381150 to match real name
- Reordered functions
@Asiern Asiern force-pushed the d_snd_harp_song_mgr branch from a8f637f to 26f4a90 Compare November 16, 2025 15:04
@elijah-thomas774 elijah-thomas774 merged commit da46df4 into zeldaret:main Nov 16, 2025
1 check passed
@Asiern Asiern deleted the d_snd_harp_song_mgr branch November 16, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants